package com.asset.dispoal.assetInstitutionBatchParameter;

import com.asset.dispoal.assetInstitutionBatchParameter.api.AssetInstitutionBatchParameterService;
import com.asset.dispoal.assetInstitutionBatchParameter.dto.AssetInstitutionBatchParameterRequest;
import com.asset.dispoal.assetInstitutionBatchParameter.dto.AssetInstitutionBatchParameterResponse;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import tech.mhuang.pacebox.springboot.protocol.Result;
import tech.mhuang.pacebox.springboot.protocol.data.PageVO;

import java.util.List;

/**
 * @author qr
 * @date 2022/3/29$
 */
@RestController
@Api(value = "种类罚息规则配置", tags = "种类罚息规则配置")
@RequestMapping("sys/assetInstitutionBatchParameter")
public class AssetInstitutionBatchParameterController {

    @Autowired
    AssetInstitutionBatchParameterService assetInstitutionBatchParameterService;


    @PostMapping("insert")
    @ApiOperation(value = "新增", notes = "新增")
    public Result insert(@RequestBody List<AssetInstitutionBatchParameterRequest> request) {
        assetInstitutionBatchParameterService.insert(request);
        return Result.ok();
    }

    @PostMapping("update")
    @ApiOperation(value = "修改", notes = "修改")
    public Result update(@RequestBody List<AssetInstitutionBatchParameterRequest> request) {
        assetInstitutionBatchParameterService.update(request);
        return Result.ok();
    }

    @PostMapping("delete")
    @ApiOperation(value = "删除", notes = "删除")
    public Result del(@RequestBody String id) {
        assetInstitutionBatchParameterService.delete(id);
        return Result.ok();
    }

    @GetMapping("queryPage")
    @ApiOperation(value = "分页查询", notes = "分页查询")
    public Result<PageVO<AssetInstitutionBatchParameterResponse>> queryPage(AssetInstitutionBatchParameterRequest request) {
        return assetInstitutionBatchParameterService.queryPage(request);
    }
}
